e<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<base href="<%=basePath%>">
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css"
	href="bootstrap-rs/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="bootstrap-rs/themes/icon.css">
<link rel="stylesheet" type="text/css" href="bootstrap-rs/demo.css">
<script type="text/javascript" src="bootstrap-rs/jquery.min.js"></script>
<script type="text/javascript" src="bootstrap-rs/jquery.easyui.min.js"></script>

<style type="text/css">
body {
	padding-bottom: 40px;
}

.sidebar-nav {
	padding: 9px 0;
}

@media ( max-width : 980px) {
	/* Enable use of floated navbar text */
	.navbar-text.pull-right {
		float: none;
		padding-left: 5px;
		padding-right: 5px;
	}
}
</style>
</head>
<body>
	<form action="sys/role/update" method="post" class="definewidth m20">
		<table class="table table-bordered table-hover m10">

				<tr><td>
					<input type="hidden" name="role.nRoleid" value="${dto.role.nRoleid }">
				</td></tr>
			<tr>
				<td class="tableleft">角色名:</td>
				<td><input type="text" name="role.vRolename" value="${dto.role.vRolename }" /></td>
			</tr>
			<tr>
				<td class="tableleft">菜单功能:</td>
				<td><c:forEach items="${menus }" var="menus">
					<!-- 定义一个变量 记录当前角色是否具有该菜单编号 默认不是 -->
					<c:set var="flag" value="false"></c:set>
					<c:forEach items="${roleMenu }" var="r">
						<c:if test="${r.nMenuid eq menus.nMenuid }">
						<c:set var="flag" value="true"></c:set>
						</c:if>
					</c:forEach>
						<input type="checkbox" name="mids" ${flag eq true?'checked':'' } value="${menus.nMenuid }" />${menus.vMenuname  }
					<br></c:forEach></td>
			</tr>

			<tr>
				<td class="tableleft"></td>
				<td>
					<button type="submit" class="btn btn-primary" type="button">保存</button>
					&nbsp;&nbsp;
					<button type="button" class="btn btn-success" name="backid"
						id="backid">返回</button> &nbsp;&nbsp;
					<button type="reset" class="btn btn-success" name="reset">重置</button>
				</td>
			</tr>
		</table>

	</form>
</body>
<script type="text/javascript">
	$(function() {
		$('#backid').click(function() {
			window.setTimeout(function() {
				window.location.href = "sys/role/query";
			}, 3)

		});

	});
</script>
</html>
